package com.lagou.rpc.consumer.controller;

import com.lagou.rpc.consumer.server.UserServer;
import com.lagou.rpc.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @param id
 * @author oyz
 * @version 1.0
 * @description: TODO
 * @date 2022/2/23 21:50
 */
@RestController
@RequestMapping("/user")
public class ClientController {


    @Autowired
    private UserServer userServer;

    @RequestMapping("/getById/{id}")
    public User getUser(@PathVariable int id ){
        User user = userServer.getIUserService().getById(id);
        return user;
    }



}
